yue = 50
while yue!=0:

    import random

    ran = random.randint(0, 150)

    print(ran)

    while True:
        if yue >= 0:
            print("当前余额", yue)
            yue -= 10
            shuzi = input("请输入数字，一次10元")
            if shuzi.isdigit():
                shuzi = int(shuzi)
                if 0 <= shuzi <= 150:
                    if ran == shuzi:
                        print("恭喜哦")
                        yue += 30
                        print(yue)
                        break
                    elif shuzi > ran:
                        print("输入过大")
                    elif ran > shuzi:
                        print("输入过小")
                else:
                    print("超出范围")
            else:
                print("非法字符")
        else:
            print("穷逼")
            break
